﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using MyDB;
using MyClassLibrary;

namespace MyProgram
{
    public partial class FrmDrugOverAdd : FrmBaseModify
    {
        public FrmDrugOverAdd()
        {
            InitializeComponent();
        }

        MedicareDataClassesDataContext db = new MedicareDataClassesDataContext();

        private void button1_Click(object sender, EventArgs e)
        {
            DrugOverview div = new DrugOverview 
            {
                項目_英文名稱_ = this.textBox1.Text,
                中文名稱 = this.textBox2.Text,
                藥品單位含量 = this.textBox3.Text,
                使用方法 = this.textBox4.Text,
                使用劑量 = this.textBox5.Text,
                藥品外觀 = this.textBox6.Text,
                適應症 = this.textBox7.Text,
                副作用 = this.textBox8.Text,
                警語 = this.textBox9.Text,
                用藥指示 = this.textBox10.Text,
                特殊與否 = this.checkBox1.Checked                 
            };

            db.DrugOverviews.InsertOnSubmit(div);
            db.SubmitChanges();

            this.Close();
        }

        private void button2_Click(object sender, EventArgs e)
        {
            this.Close();
        }
    }
}
